package com.ijava.util;

import java.io.Serializable;

public class DTreeBean implements Serializable {
	//id, pid and name url title target
	private String id;
	private String pid;
	private String name;
	private String url;
	private String title;
	private String target;
	
	
	public DTreeBean(String id, String pid, String name) {
		super();
		this.id = id;
		this.pid = pid;
		this.name = name;
	}
	
	
	public DTreeBean(String id, String pid, String name, String title) {
		super();
		this.id = id;
		this.pid = pid;
		this.name = name;
		this.title = title;
	}

	

	public DTreeBean(String id, String pid, String name, String url,
			String title, String target) {
		super();
		this.id = id;
		this.pid = pid;
		this.name = name;
		this.url = url;
		this.title = title;
		this.target = target;
	}


	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getPid() {
		return pid;
	}
	public void setPid(String pid) {
		this.pid = pid;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getUrl() {
		return url;
	}
	public void setUrl(String url) {
		this.url = url;
	}
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	public String getTarget() {
		return target;
	}
	public void setTarget(String target) {
		this.target = target;
	}
//	public String toString(String dtreeObject) {
//		StringBuilder builder = new StringBuilder();
//		builder.append("DTreeBean [id=");
//		builder.append(id);
//		builder.append(", pid=");
//		builder.append(pid);
//		builder.append(", name=");
//		builder.append(name);
//		builder.append(", url=");
//		builder.append(url);
//		builder.append(", title=");
//		builder.append(title);
//		builder.append(", target=");
//		builder.append(target);
//		builder.append("]");
//		return builder.toString();
//	}
	public String toString(String dtreeObject) {
		//d.add(0,-1,'<spring:message code="organization.manager"/>');
		StringBuilder builder = new StringBuilder(dtreeObject);
		builder.append(".add(");
		if (id != null) {
			builder.append("\"");
			builder.append(id);
			builder.append("\", ");
		}
		if (pid != null) {
			builder.append("\"");
			builder.append(pid);
			builder.append("\", ");
		}
		if (name != null) {
			builder.append("\"");
			builder.append(name);
			builder.append("\", ");
		}
		if (url != null) {
			builder.append("\"");
			builder.append(url);
			builder.append("\", ");
		}
		if (title != null) {
			builder.append("\"");
			builder.append(title);
			builder.append("\", ");
		}
		if (target != null) {
			builder.append("\"");
			builder.append(target);
			builder.append("\"");
		}
		builder.append(");");
		return builder.toString();
	}
	
	
}
